import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function querySystemTreeList(params) {
  return http.request<HttpResult>("get", "/admin/easysystree/get/list", {
    params: params
  });
}

export function querySystemTreeTable(params) {
  return http.request<HttpResult>("get", "/admin/easysystree/get/table", {
    params: params
  });
}

export function querySystemTreeValid(params) {
  return http.request<HttpResult>("get", "/admin/easysystree/get/exists", {
    params: params
  });
}

export function querySystemTreeNodeTable(params) {
  return http.request<HttpResult>(
    "get",
    "/admin/easysystreenode/get/treetable",
    {
      params: params
    }
  );
}

export function querySystemTreeNode(params) {
  return http.request<HttpResult>("get", "/admin/easysystreenode/get/tree", {
    params: params
  });
}

export function deleteSystemTree(ids) {
  return http.request<HttpResult>("post", `/admin/easysystree/delete/${ids}`);
}

export function addSystemTree(params) {
  return http.request<HttpResult>("post", "/admin/easysystree/insert", {
    data: params
  });
}

export function updateSystemTree(params) {
  return http.request<HttpResult>("post", "/admin/easysystree/update", {
    data: params
  });
}

export function deleteSystemTreeNode(ids) {
  return http.request<HttpResult>(
    "post",
    `/admin/easysystreenode/delete/${ids}`
  );
}

export function addSystemTreeNode(params) {
  return http.request<HttpResult>("post", "/admin/easysystreenode/insert", {
    data: params
  });
}

export function updateSystemTreeNode(params) {
  return http.request<HttpResult>("post", "/admin/easysystreenode/update", {
    data: params
  });
}
